<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>毁掉页面</title>
</head>
<script src="pluging/vue/dist/vue.js"></script>
<script src="pluging/axios/dist/axios.js"></script>
<script src="script/comme.js"></script>
<body>

<div id="myDiv">

</div>
<script type="text/javascript">
    new Vue({
        el:"#myDiv",
        data:{

        },
        mounted(){
            var pare = pareUrl();

            this.$http.post("/logininfo/wechat/"+pare.code)
                        .then(res => {
                            res=res.data
                           if(res.success){
                               let {openid,access_token}=res.object
                               if(res.object.msg){
                                   location.href="/binder.html?access_token="+access_token+"&openid="+openid

                               }else {
                                   localStorage.setItem('token',res.object.token)
                                   localStorage.setItem("userInfo",JSON.stringify(res.object.userInfo))
                                   location.href="/list.html"
                               }
                           }else{
                               alert(res.message)
                           }
                        })
                        .catch(res => {
                            alert("失败")
                        })
        }
    })
</script>
</body>
</html>